﻿using System;
using System.Collections.Generic;

using System.Text;
using System.Data.SqlClient;

namespace Model
{
    public static class DBConnection
    {
        private static string _connectionString;
        private static SqlConnection _connection;

        public static string ConnectionString
        {
            get
            {
                if (string.IsNullOrEmpty(_connectionString))
                {
                    _connectionString = @"Data Source=97.74.205.162;Initial Catalog=rti-clients;User ID=sgit;Password=123";
                }

                return _connectionString;
            }
        }

        public static SqlConnection Connection
        {
            get
            {
                if (_connection == null)
                {
                    _connection = new SqlConnection(ConnectionString);
                    
                    
                    _connection.Open();
                }
                return _connection;
            }
        }
    }
}
